@import '../common.less';

.history-selector-wrapper {
  position: relative;
}

.history-modal-overlay {
  position: fixed;
  top: auto;
  right: 20px;
  bottom: 20px;
  width: 320px;
  height: 400px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 9999;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.history-modal-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;

  /* top title bar */
  .history-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 48px;
    line-height: 48px;
    padding: 0 25px;

    .close-button {
      margin-right: -4px;
      padding: 4px;
      display: flex;
      align-items: center;
      justify-content: center;

      .anticon {
        font-size: 18px;
        color: #999999;
      }

      &:hover .anticon {
        color: #666666;
      }
    }
  }

  /* search bar */
  .history-search-section {
    padding: 16px 20px;
    background: #ffffff;

    .search-input-wrapper {
      display: flex;
      align-items: center;
      gap: 12px;
      color: rgba(0, 0, 0, 0.25);

      .search-input {
        flex: 1;
        height: 36px;
        border-radius: 16px;
        background: rgba(241, 242, 243, 1);
        border: none;

        .ant-input {
          background: transparent;
          border: none;
          box-shadow: none;
        }

        &:hover,
        &:focus-within {
          border-color: #d9d9d9;
          background: #ffffff;
        }
      }

      .clear-button {
        color: #1890ff;
        padding: 0;
        height: auto;

        &:hover {
          color: #40a9ff;
        }
      }
    }
  }

  /* history content */
  .history-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 25px 25px 25px;

    .history-group {
      margin-bottom: 10px;

      .history-group-title {
        font-size: 12px;
        color: rgba(0, 0, 0, 0.45);
        height: 40px;
        line-height: 40px;
        font-weight: 400;
      }

      .history-item {
        cursor: pointer;
        height: 40px;
        line-height: 40px;
        font-size: 14px;
        color: rgba(0, 0, 0, 0.85);
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;

        &:hover {
          background: rgba(242, 244, 247, 1);
          padding: 0 8px;
          margin: 0 -8px;
        }
      }
    }

    .no-results {
      text-align: center;
      padding: 40px 20px;
      color: #999999;
    }
  }
}
